package behaviour.observer_java;

import java.util.Observable;

/**
 * 被观察者
 *
 * @author yeyangtao created at 2020/7/7 14:51
 */
public class Watched extends Observable {
    private int state;

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
        setChanged();
        notifyObservers();
    }
}
